home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 051-075 / disk_059 / dme / doc.txt < prev    next >
Text File  |  1992-05-06  |  20KB  |  480 lines

  1. DOC.TXT
  2.  
  3. DME V1.21 (c)CopyRight 1987, Matthew Dillon.  All Rights Reserved.
  4. This software may be freely distributed only in the following forms:
  5.  
  6.     (1) this document plus the source
  7.     (2) this document plus the executable
  8.     (3) this document plus the source plus the executable
  9.  
  10.     Matthew Dillon
  11.     891 Regal Rd
  12.     Berkeley, Ca. 94708
  13.  
  14.     USENET   ihnp4!ucbvax!dillon
  15.     ARPANET  dillon@ucbvax.berkeley.edu
  16.  
  17. ---------------------------------------------------------------------------
  18.  
  19.  
  20.  
  21. I   Overview
  22. II  Keymapping          keymapping
  23. III Command Sequences   DME commands
  24. IV  File Particulars    notes on loading and saving files
  25. V   Revision Summary    revision numbering
  26. VI  Compiling           compiling instructions
  27.  
  28.                                     I
  29.                                  OVERVIEW
  30.  
  31.  
  32. DME is a (simple?) WYSIWYG editor designed for programmers (i.e. it is not
  33. a word processor).  I consider the following aspects of DME 'features':
  34.  
  35.         -control language based on a rich command set accessed manually
  36.          or via arbitrary mapping of keys.  (Every key may be mapped to 8
  37.          different things)
  38.  
  39.         -fast visual response (it scrolls quickly)
  40.  
  41.         -title-line statistics showing your current position in the file,
  42.          file name, whether the file has been modified or not, etc...
  43.  
  44.         -(new for V1.21)    Multiple Windows, ability to iconify windows
  45.  
  46. DME has been designed to allow easy expansion, and I intend to make many
  47. future improvments.  It has not been designed for user friendliness, but is
  48. straight forward if you read this document fully.
  49.  
  50. DME optionaly takes a single argument which is the file to edit.
  51. Additionaly, DME will SOURCE (see section III) C:.EDRC, and the .EDRC
  52. in the current directory on startup, allowing for both a generarlized
  53. and a specialized initialization file.  The files contain DME commands
  54. (usually keymappings, but can be anything).  Both C:.EDRC and .EDRC are
  55. sourced after the (optional) file is loaded.
  56.  
  57.  
  58.                                     II
  59.                                  KEYMAPPING
  60.  
  61. MOUSE SELECT (LEFT ) BUTTON:
  62.     There is no designation to map the left button.
  63.  
  64.     positions cursor at the indicated spot.  The cursor now tracks the
  65.     mouse.
  66.  
  67.  
  68. MOUSE MENU (RIGHT) BUTTON:
  69.     There is no designation to map the right button.
  70.  
  71.     This button iconifies the current active window if not iconified, and
  72.     de-iconifies the window if iconified (Try IT!).  The iconification
  73.     features:
  74.         -Remembers original window size and placement
  75.         -Remembers placement of iconified window when you re-iconify later.
  76.  
  77.     Currently, you will crash the machine if you run out of memory and DME
  78.     is unable to open the icon window or original window, so be careful.
  79.  
  80.  
  81. KEYBOARD:
  82.  
  83. The rest of the Functional interface for DME is based on keymappings and a
  84. rich command set.  Unlike other text editors, any non-qualifier key in DME
  85. may have any meaning whatsoever.  It just so happens that the default
  86. keymappings assign such things as the `return' key to the RETURN function,
  87. the `up' key to the UP function, etc...  Keys are named by their keycap
  88. labels with the following exceptions:
  89.  
  90.     the name for Back-Space is  BS
  91.     the name for numeric keypad keys are prepended with an NK, except for
  92.     the Enter key which is named 'ENTER'.
  93.     The four cursor control keys are labeled UP, DOWN, LEFT, and RIGHT
  94.  
  95. *NOTE*  You must type commands in lower-case, except for text, which can
  96. be either lower or upper case, and for upper-case alpha keys when specifying
  97. keymaps (i.e.  A and s-a are the same key).
  98.  
  99. Each key may be qualified with any combination of CTRL, ALT, or SHIFT
  100. keys.  With three qualifier keys, you can assign up to 8 different meanings
  101. per physical (non qualifier) key on the keyboard.
  102.  
  103. NOTE that the CAPS-LOCK, when lit, only effects Alpha Keys.
  104.  
  105.     ***EXAMPLES:***
  106.  
  107.     tab         tab
  108.     s-tab       SHIFT tab
  109.     c-tab       CTRL tab
  110.     ac-?        ALT-CTRL ?
  111.     s-f5        SHIFT F5
  112.     nk0         Numeric Keypad 0
  113.     cs-nk0      CTRL SHIFT Numeric Keypad 0
  114.  
  115.     ***************
  116.  
  117. The Default Mappings are as follows:
  118.  
  119.     All Printable Ascii keys mapped to their ascii equivalent
  120.     BS, DEL, UP, DOWN, LEFT, RIGHT, TAB, S-TAB, ENTER mapped properly
  121.  
  122.     return      Mapped to a sequence which also inserts a new line and
  123.                 autoindents the cursor. Not to be confused with the
  124.                 RETURN command.
  125.  
  126.     esc         Toggle Command Line Entry (CLE?) mode.
  127.     s-up        Top of Text
  128.     s-left      Column 0
  129.     s-down      Botton of Text
  130.     s-right     Last Column in line
  131.     `s- '       shift space mapped to space
  132.     c-up        Page up
  133.     c-down      Page down
  134.  
  135.     s-del       Delete Line
  136.     c-del       Remove to End Of Line
  137.     c-l         previous word
  138.     c-r         next word
  139.     c-i         Insert Mode
  140.     c-o         Overstrike Mode
  141.     c-j         Join line
  142.     c-s         Split line
  143.     c-n         Find Next
  144.     c-p         Find Prev
  145.     c-/         (Prompts for Find string)
  146.  
  147.     c-b         Start-End block
  148.     c-u         Unblock (reset block markers to NULL)
  149.     a-c         Copy block   (insert before current line)
  150.     a-d         Delete Block
  151.     a-m         Move Block   (insert before current line)
  152.     a-s         Source Block    (bsource)
  153.     a-S         Source current line (unblock block block bsource)
  154.                     this command makes life easy when designing keymaps.
  155.                     (Remember: a-S equivalent to sa-s)
  156.  
  157.     f1          (Prompts for file to insert)
  158.     f2          (Prompts for new file to load.. replaces previous text)
  159.     f3          (Prompts for file to load into a new window)
  160.     f7          Save block (Prompts for filename)
  161.     f8          Save & open new file (Pompts for filename after save)
  162.     f9          Save (do not quit)
  163.     f10         Save and Quit
  164.  
  165.                 To see how these keys are bound, use the SAVESMAP command.
  166.  
  167.  
  168.                                     III
  169.                              COMMAND SEQUENCES
  170.  
  171. DME has a rich command set which allows you to embed commands within
  172. commands, or specify multiple commands in a row.  A command consists
  173. of a KEYWORD followed by a FIXED number of arguments (0, 1, 2...).  The
  174. argument delimeter in DME is a SPACE.  Therefore, to embed strings
  175. containing spaces as a single argument, you must surround the string with
  176. `string' (backquote-string-quote).  TEXT to be written as if typed is also
  177. specified via a string in backquote-quotes.  For example:
  178.  
  179.     right right `hello' right right `hello' enter down
  180.     map f4 `right right' map f5 `left left'
  181.     map f4 ``hello''
  182.  
  183. Reiterating (because this is important!)... If a command expects ONE
  184. argument, then it really does expect a single argument, and any remaining
  185. arguments are thought to be the next command... so:
  186.  
  187.     map f4 right
  188.                                     -right is only one word, so no need
  189.                                      for `'.
  190.     map f4 `right right'
  191.                                     -we want to map f4 to two rights... we
  192.                                      need the `' or the second right will
  193.                                      not be part of the map.
  194.  
  195.     map c-del `repeat cright del'
  196.                                     -this is already implimented as REMEOL,
  197.                                      but shown here for clarity.
  198.  
  199. Some arguments will eventually be fed through the command interpreter more
  200. than once.  The MAP command is a good example.  When you execute a MAP
  201. command, the first run through the command interpreter installs the map
  202. string minus a set of quotes.  So, if you want to specify text, you must
  203. enclose the text in two sets of ``text'' because the map string gets passed
  204. through the command interpreter again when you hit the mapped key.  Here
  205. are some more complex examples:
  206.  
  207.     map f4 `right right `hello' left left'      *RIGHT*
  208.     map f4 right right hello left left          *WRONG*
  209.  
  210.     map f4 `map f4 ``hello'''
  211.                                     -the first time you hit F4, it's command
  212.                                      is to re-map itself to the TEXT `hello'.
  213.                                      (gads!).
  214.  
  215.     map c-i `repeat tr `` '''
  216.                                     -example of how to embed a space in a
  217.                                      map and repeat (goes through command
  218.                                      interpreter three times!).
  219.  
  220.  
  221. An easy way to fool around executing commands or making maps is either to
  222. use the ESC key (which enters command mode), or  a-S (alt-shift-s), which
  223. EXECUTES the current DME line that the cursor is on.... so you can use DME
  224. to edit and test your new keymappings.
  225.  
  226.  
  227. !!!!!!!!!! NOTE NOTE NOTE NOTE NOTE !!!!!!!!!!!!!!
  228. You must type commands in LOWER case. They are in upper case here for
  229. visibility.
  230.  
  231.     COMMAND LIST
  232.  
  233.  
  234.  
  235.     `text'          -enter text as if typed.
  236.     BS              -Back Space: Remove char to left of cursor and move
  237.                      rest of line back one.
  238.     BACK            -same as BS
  239.     BACKTAB         -Cursor left to previous tab stop (see TABSTOP)
  240.     BCOPY           -Insert specified block infront of current cursor line
  241.     BDELETE         -Delete specified block
  242.     BLOCK           -Specify the Start or End of a block (blocks are not
  243.                         currently highlighted)
  244.     BMOVE           -Move specified block, inserting it before the current line.
  245.     BOTTOM          -Move cursor to the BOTTOM OF TEXT
  246.     BSAVE arg       -Save specified block to a file
  247.     BSOURCE         -Source specified block (you can use DME to construct commands)
  248.     DEL             -Delete Char: Remove char under cursor and move rest
  249.                         of line back one.
  250.     DELINE          -Delete the Current line
  251.     DOWN            -cursor down.  NOP if at end of text
  252.     DOWNADD         -Cursor down and add a blank line if at end of text
  253.     ESC             -ESC into Command Mode
  254.     ESCIMM arg      -ESC into Command Mode prompting with `arg'
  255.                         (see SAVESMAP to get a good example file)
  256.     FIND arg        -Search for the given string.  Case sensitive
  257.     FINDR arg arg   -As in FIND, but replace with second argument
  258.     FINDSTR arg     -SET the search string (NO search operation performed)
  259.     FIRST           -Move Cursor To Column 0
  260.     FIRSTNB         -Move cursor to first non-blank character in line
  261.     GOTO arg        -Goto the specified line number
  262.     GOTO [+/-]arg   -Goto relative current line number.  +/- N
  263.                         e.g.  GOTO -2  would jump up two lines.
  264.     IF     cond t   -If condition do operation              (SEE BELOW)
  265.     IFELSE cond t f -If condition do op. else do another op (SEE BELOW)
  266.     INSERTMODE arg  -where arg is ON, OFF, or TOGGLE
  267.                         e.g.  `insertmode toggle' toggles the current insert
  268.                         mode.
  269.     INSFILE arg     -insert a file into the current text
  270.     INSLINE         -Insert a line before the current line
  271.     JOIN            -Join next line to this line (does not move the cursor)
  272.     LAST            -Move Cursor To Last Column (spaces below and beyond)
  273.     LEFT            -cursor left
  274.     MAP key arg     -Map a key to an argument.  NOTE: argument will
  275.                         eventually be passed through command interpreter twice.
  276.     NEWFILE arg     -load a new file, replacing the old text.  If current
  277.                         file is modified, you get a requester.
  278.     NEWWINDOW       -open new window and make it the current window
  279.                         (see the F3 keymap).  Currently, you cannot do
  280.                         block copy's across windows (sorry).  Use BSAVE to
  281.                         save a block to a temporary file.
  282.     NEXT            -Search for the next occurance of the string
  283.                         (see FIND, FINDSTR)
  284.     NEXTR           -Search for next occurance and replace
  285.                         (see FINDR, REPSTR)
  286.     PAGEUP          -Page Up a Page
  287.     PAGEDOWN        -Page Down a Page
  288.     PREV            -Search for the previous occurance of the string
  289.                         (see FIND, FINDSTR)
  290.     PREVR           -Search for the previous occurance and replace
  291.                         (see FINDR, REPSTR)
  292.     REPSTR arg      -SET the replace string (NO operation is performed)
  293.     QUIT            -Quit current window without saving.  When the last
  294.                         window is closed, the editor exists.  If the text
  295.                         has been modified, put up a requester.
  296.     RETURN          -as in CR-LF.  RETURN does NOT insert a line, though it
  297.                         will add lines if at the end of text.
  298.     REMEOL          -Delete to End Of Line.
  299.     REPEAT N arg    (SEE BELOW)
  300.     RIGHT           -cursor right
  301.     SAVEOLD         -save current text as the name specified in the title line
  302.                         (NOTE: Takes NO argument!)
  303.     SAVEAS arg      -save current text as the given name
  304.     SAVEMAP arg     -save user keymappings to a sourceable typeable file
  305.     SAVESMAP arg    -save user+system keymappings to a sourceable typeable file
  306.                         (usefull for beginners)
  307.     SCREENTOP       -Home to upper left hand corner of the window
  308.     SCREENBOTTOM    -To lower left hand corner of the window
  309.     SOURCE arg      -Execute DME Commands from a file
  310.     SPLIT           -Split line at cursor (does not move the cursor)
  311.     TAB             -Cursor right to next tab stop
  312.     TABSTOP arg     -Set Tab stops (does not effect file load/save tabstops)
  313.     TOP             -Move cursor to the TOP OF TEXT
  314.     TLATE [+/-]#    -relative translation of char under cursor by # (ascii code)
  315.     TLATE #         -set character under cursor to exactly # (0 is illegal)
  316.                         tlate +1      -increment character under cursor
  317.                         tlate 65      -sets to uppercase A
  318.     UNBLOCK         -Reset block markers to nothing
  319.     UNMAP key       -Unmap a key
  320.     UP              -cursor up
  321.     WHILE cond t    -While condition, do operation (SEE BELOW)
  322.     WLEFT           -go to beginning of current word (previous word if at
  323.                      beginning of current word)
  324.     WRIGHT          -go to beginning of next word
  325.  
  326.  
  327.  
  328.  
  329.     -------------------------------------------------------------------
  330.     Command which cause a command line to abort (e.g. in repeat, while):
  331.  
  332.     FIND[R]/NEXT[R]/PREV[R]  when the string is not found.  NEXT stops at
  333.     the end of the file, PREV stops at the beginning.
  334.  
  335.     DOWN,LEFT,RIGHT,UP  when the operation cannot be done.
  336.     -------------------------------------------------------------------
  337.  
  338.  
  339.     REPEAT N arg    -Repeat `arg' N times.  Apart from being a number, N
  340.                      can also be one of:
  341.  
  342.                         line    Current line # (lines begin at 1)
  343.                         lbot    #lines to the bottom, including current line
  344.                         cleft   column # (cols begin at 0)
  345.                         cright  #chars to eol, including current char under cursor
  346.                         tr      #char positions to next tab
  347.                         tl      #char positions to next back tab
  348.  
  349.                     Certain commands can abort a REPEAT loop.  Specifically,
  350.                     any FIND[R], NEXT[R], or PREV[R] in which the search
  351.                     string is NOT found will abort a REPEAT.
  352.  
  353.                     Specifying -1 as N causes REPEAT to go on forever
  354.                     (well, actually, 0xFFFFFFFF times).
  355.  
  356.     IF condition arg
  357.     WHILE condition arg
  358.     IFELSE condition arg elsearg
  359.  
  360.             If the specified condition is true, execute the argument.  For
  361.             WHILE, the argument is executed until the condition is false
  362.             (be careful!).
  363.  
  364.             Conditions:
  365.  
  366.             #       if toggle entry # is SET
  367.             t       if On line 1
  368.             b       if On last line
  369.             l       if At column 0
  370.             r       if At end of line (spaces below and beyond)
  371.             m       if Text has been modified
  372.             i       if in insert mode
  373.             cl      character under cursor is lower case alpha
  374.             cu      character under cursor is upper case alpha
  375.             ca      character under cursor is alpha-numeric
  376.             cn      character under cursor is numeric
  377.             c#      character under cursor is ascii code # (# in decimal)
  378.  
  379.         Example: simulating an insert mode toggle: ALT-i (not CTL-i)
  380.  
  381.      map a-i `ifelse 0 `toggle 0 insertmode OFF' `toggle 0 insertmode ON''
  382.  
  383.         Example: while lower case, map to upper case and move right.
  384.  
  385.      map c-U `while cl `tlate -32 right''
  386.  
  387.  
  388.     WARNING:    It is possible to get into infinite loops with REPEAT and
  389.                 WHILE.  Currently, BREAK is *not* handled by the open
  390.                 window, but by whatever executed DME.  That is, you must
  391.                 either Ctl-C from your CLI, or send a BREAK to the DME
  392.                 process.  I hope to fix this soon.
  393.  
  394.  
  395.  
  396.                                     IV
  397.                              FILE PARTICULARS
  398.  
  399. No Matter what you set internal tabs to, tabs in disk files will be 8.
  400. However, in the current implimentation, DME writes out spaces instead of
  401. tabs anyway.
  402.  
  403. The command to save the current document under the default name is
  404. SAVEOLD, *not* SAVE.  SAVE is not a valid command.  This is to prevent
  405. people who have not read the documentation from assuming 'save' takes an
  406. argument (and screwing up their work).  SAVEOLD does NOT take an
  407. argument, SAVEAS does.
  408.  
  409.  
  410.                                     V
  411.                               REVISION SUMMARY
  412.  
  413. V1.21 RELEASE (BUG FIXES FROM 1.20)
  414.     -iconify and window handling fixed
  415.     -left mouse button now tracks the mouse.
  416.  
  417. V1.20 RELEASE
  418.     -bug fixes: bsave now unmarks the block, bdelete now sets 'modified' flag.
  419.             (other small fixes).
  420.     -enhancements: overwrite mode status indicator, find, find-replace now
  421.             completely implemented (yahhoo!!!)
  422.     -changed commands:  FIND NEXT PREV: no longer loop back to the top of
  423.             file or top->bottom in the case of PREV.  DELINE will now delete
  424.             text on the line if there is only one line of text.
  425.     -enhanced commands: GOTO REPEAT
  426.     -new commands: SAVEMAP SAVESMAP TOGGLE SETTOGGLE RESETTOGGLE TLATE
  427.                    IF IFELSE WHILE BSOURCE
  428.                    FINDSTR REPSTR FINDR NEXTR PREVR
  429.                    NEWWINDOW
  430.     -new keymappings: (see a-s, a-S, f3)
  431.     -window iconification with mouse menu button.
  432.  
  433.  
  434. V1.12 RELEASE
  435.     -cursor is now pen #3 rather than #1.
  436.     -changeover to AZTEC C, smaller executable.
  437.     -now maps shift space to a space.
  438.     -new commands: REMEOL, WLEFT, WRIGHT
  439.     -display bug fixes (SPLIT)
  440.     -FIND/PREV/NEXT will now abort a REPEAT if string not found.
  441.  
  442. V1.11 RELEASE NOTES
  443.     -Bug fixes (mainly graphical mistakes).
  444.     -User keymappings are disabled in command mode (so you can unmap
  445.       single ascii characters you may have mapped).
  446.     -Illegal key combinations no longer give garbage (e.g. ALT-CURSOR-DOWN)
  447.       you can, of course, still map them to anything you wish.
  448.     -Save now checks for error conditions on write.
  449.     -Uses Default Console Keymap (i.e. no longer assumes USA)... but there
  450.       *is* some stangeness.
  451.  
  452. V1.00 RELEASE NOTES
  453.     -has find, but no replace function
  454.     -marked blocks are not highlighted
  455.     -assumes USA keyboard                   (fixed 1.11)
  456.     -disk files written out use spaces instead of tabs&spaces
  457.     -No scroll bar yet.
  458.  
  459.  
  460.                                     VI
  461.                                 COMPILING
  462.  
  463.  
  464. DME now compiles under AZTEC.  You must compile with the 32 bit int option,
  465. but may use the small code/data model.  You must use V3.00 or above of
  466. MY.LIB  (MY32.LIB), dated MARCH 1987
  467.  
  468.     cc +L -S NAME.c             (for each .C module)
  469.     ln *.o -lmy32 -lcl32 +Q
  470.  
  471.  
  472. To compile DME under lattice requires the MY.LIB version 3.00 or above:
  473.  
  474.     lc1 -oram: -iinclude: NAME.C
  475.     lc2 -s -v -oNAME.o ram:NAME.q
  476.  
  477.     blink lattice:Astartup.obj library lib:my.lib+lib:amiga.lib to ram:dme ND
  478.  
  479.  
  480.